#!/bin/sh

# ----------------------------------------------------------------------
# Filename:   File.sh
# Version:    1.0
# Date:       2013/09/06
# Author:     yuanhui.shi
# Email:      yuanhui.shi@cs2c.com.cn
# Summary:    Check if the result is right
# Notes:      only a function "CheckFile"
# Copyright:  China Standard Software Co., Ltd.
# History：     
#             Version 1.0, 2013/03/30
#             - The first one
# ----------------------------------------------------------------------

##! @TODO: Check if the files exists
##! @AUTHOR: yuanhui.shi
##! @VERSION: 1.0 
##! @OUT: Confirm the result that files exists

PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH

source ../../lib/Echo.sh

function CheckFile()
{
    RC=0
    for var in ${file}
    do
        test -f $var 
        #EchoResult "$var,该文件存在\n" 
        if [ $? -ne 0 ];then
            echo -e "\033[31m FAIL\033[0m | $var,该文件不存在"
            RC=$((RC+1))
        else
            echo -e "\033[32m PASS\033[0m | $var,该文件存在"
        fi
    done
    return $RC
}

